//5：定义一个字符串，输出他对应的字节和字符。
package Work0524;

import java.util.Scanner;

public class Character {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("输入一个字符串:");
		String a = in.next();
		char[] d = a.toCharArray();
		System.out.print("字符为:");
		for (int e = 0; e < d.length; e++) {
			System.out.print("" + d[e]);
		}
		System.out.println();

		byte[] b = a.getBytes();
		System.out.print("字节为:");
		for (int c = 0; c < b.length; c++) {
			System.out.print("" + b[c]);
		}
	}

}
